package com.serviceImpl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.bean.Unit;
import com.mapper.UnitMapper;
import com.service.UnitService;

/**
 * @author  author : 张鹏
 * @date createTime：2018年1月10日 下午10:50:54 
 * @Description: 该类的功能描述
 */
@Service
public class UnitServiceImpl implements UnitService {
	@Resource
	private UnitMapper unitMappser;
	
	
	@Override
	public List<Unit> getAllUnit() {
		return unitMappser.selectAll();
	}

	@Override
	public int createNewUnit(Unit unit) {
		return unitMappser.insert(unit);
	}

	@Override
	public int deleteUnit(int unitId) {
		
		return unitMappser.deleteByPrimaryKey(unitId);
	}

	@Override
	public int editUnit(Unit unit) {
		return unitMappser.updateByPrimaryKey(unit);
	}

}
